home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
business
/
jivepost.zip
/
JIVE.SRC
< prev
next >
Wrap
Text File
|
1996-04-13
|
16KB
|
531 lines
# ┌──────────────────────────────────────────────────────────────────────────┐
# │ JIVE.SRC (Chuckle Box Jive Posts) │
# │ │
# │ Version: 1.0 (Released 13 Apr 1996) for SBBS 2.20 - Rev B │
# │ Author: Robert Nykvist aka Chuckles@LAUGHBOX │
# │ │
# │ Warning: This script is intended for SBBS systems running │
# │ SBBS 2.20 or higher. It ALTERS Flags, message │
# │ area set, message reading functions (header), and │
# │ imports files into SMB, and creates files. Please │
# │ Read the DOCS closely before running this Script. │
# │ │
# └──────────────────────────────────────────────────────────────────────────┘
!INCLUDE SBBSDEFS.INC
!INCLUDE FILE_IO.INC
# ┌───────────────────────────────────────────────────────────┐
# │ Give User the $F1B Flag which is an Access requirement │
# │ to the JIVE smb if you have set it up properly. │
# └───────────────────────────────────────────────────────────┘
compare_ars $F1B
if_false
toggle_user_flag 1 B
end_if
# ┌───────────────────────────────────────────────────────────┐
# │ Replacing some TEXT.DAT to customize reading of Messages. │
# │ Note, these REVERT back to original when leaving script. │
# └───────────────────────────────────────────────────────────┘
replace_text 1 ""
replace_text 2 ""
replace_text 3 ""
replace_text 4 ""
replace_text 5 ""
replace_text 6 "\r\n\1n\1y\1\hJive by %%s\r\n\r\n"
replace_text 7 ""
replace_text 8 ""
replace_text 9 "gh─────────────────────────────────────────────────────────────────────────────ng"
# ┌────────────────────────────────────────────────────────────────┐
# │ Portion of Read Message Prompt HIDDEN below using ^AZ (\1\26) │
# │ See your SBBS Manual on page 244 for Hidden Display Info. │
# │ Note, this REVERTs back to original when leaving script. │
# │ If $F1Z is being used, change the "\1\26" to flag not used. │
# │ Objective? To keep reading clutter to a minimum. KISS │
# │ (Keep it Simple Stupid). I want them to see the message, │
# │ not the extra header and prompt data they don't need to know. │
# └────────────────────────────────────────────────────────────────┘
replace_text 71 "\r\nhgPost \1\26[%%u] %%s [%%u] %%s \1\) w%%lung of hw%%lu g?ng=Menu hw: "
# ^Begin Hide ^End Hide
# ┌───────────────────────────────────────────┐
# │ Top of Menu - Change Menu as you see fit. │
# └───────────────────────────────────────────┘
:top
cls
crlf
crlf
print "hìm────────w5▌ Chuckle Box Jive Posts k▐nm──h──────\r\n"
crlf
print "òw▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄n▄\r\n"
print "òh█2 Jive Post Jive Post Jive Pok0█\r\n"
print "òw█2t Jive Post Jive Post Jive Pk0█\r\n"
print "òw█2st Jk0█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀w█2ive k0█\r\n"
print "òw█2ost k0█æw█2Jivek0█\r\n"
print "òw█2Postk0█ä(yVk) wVngiewähw█2 Jivk0█\r\n"
print "òw█2 Posk0█ä(yIk) wIngnfoähw█2t Jik0█\r\n"
print "òw█2e Pok0█ä(yAk) wAngdd ähw█2st Jk0█\r\n"
print "òw█2ve Pk0█ä(yQk) wQnguitähw█2ost k0█\r\n"
print "òw█2ive k0█æw█2Postk0█\r\n"
print "òw█2Jivek0█w▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█2 Posk0█\r\n"
print "òw█2 Jive Post Jive Post Jive Pok0█\r\n"
print "òw█2t Jive Post Jive Post Jive Pk0█\r\n"
print "òn▀hk▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\r\n"
crlf
# ┌────────────────────────────────────────────────────┐
# │ Note Node Location & make sure things are in SYNC. │
# │ before getting input. ASYNC allows menu abort. │
# └────────────────────────────────────────────────────┘
node_action node_xtrn
sync
# ┌──────────────────────────────────────────┐
# │ Get User Input : View, Add, Info or Quit │
# └──────────────────────────────────────────┘
print "ÜmEnter y(wV,I,A,Qy) w> n"
getcmd AIQV?
# ┌──────────────┐
# │ Re-Send Menu │
# └──────────────┘
cmdkey ?
cmd_pop
goto top
end_cmd
# ┌──────────────────────────────────────────┐
# │ User Wants to Add Jivepost - GOTO WRITE │
# └──────────────────────────────────────────┘
cmdkey A
cmd_pop
goto write
end_cmd
# ┌───────────────────────────────────────┐
# │ Display Instructions/Info │
# │ Give Credit where Credit is Due. Tnx │
# └───────────────────────────────────────┘
cmdkey I
cls
crlf
crlf
print "ònhyChuckle Box Jive Posts w- rVer 1.0\r\n"
print "ònmFor SBBS 2.20 by hRobert Nykvist\r\n"
crlf
print "wView Jive Posts\r\n"
print " r■ ngWhen viewing jiveposts, you return to the last post you read.\r\n"
print " hr■ ncPress Enter to read the next message if there are any.\r\n"
print " hr■ ngGo back and read old messages by entering smaller number.\r\n"
print " hr■ ncPress Q to Quit.\r\n"
print " hr■ ngPress ? for the Reading Mesages Menu.\r\n"
crlf
print "hwAdd a Jive Post\r\n"
print " r■ ngEnter your text one line at a time, up to four lines.\r\n"
print " hr■ ncYou will be prompted to convert your message.\r\n"
print " hr■ ngYou can convert your message to Jive, Valleyspeak or Mix of both.\r\n"
print " hr■ ncThe Jive Poster alters your message and then,\r\n"
print "ädisplays the converted text to see if you want to save it.\r\n"
print " hr■ ngSave it or start all over.n\r\n"
crlf
pause
cmd_pop
goto top
end_cmd
# ┌─────────────┐
# │ Quit Script │
# └─────────────┘
cmdkey Q
cmd_pop
goto byebye
end_cmd
# ┌────────────────────────────────────────────┐
# │ User Chooses to View Jiveposts - GOTO VIEW │
# └────────────────────────────────────────────┘
cmdkey V
cmd_pop
goto view
end_cmd
# ###################### End of Main Menu GETCMD Options ######################
# Fall through just in case.
cmd_pop
goto top
# ┌───────────────────────────────────┐
# │ Display Jive │
# │ Set present message area to JIVE └───────────────┐
# │ Restrict your message base setup for JIVE SMB so │
# │ Users will not be able to write posts normally. │
# │ Set Write Level to 100 │
# └───────────────────────────────────────────────────┘
:View
setstr "jive"
msg_set_area
msg_read
cmd_pop
goto top
# ┌──────────────────────────────────────────┐
# │ Add Jive - Get message, then convert it │
# └──────────────────────────────────────────┘
:Write
cls
crlf
crlf
# ┌───────────────────────────────────────┐
# │ Define Strings for each line of input │
# │ Use GETSTR to get user input. │
# └───────────────────────────────────────┘
str one two three four
print "rhWrite message now. y (w4nc-Lines Maxhy) nm Press ENTER at end of each line! \r\n"
crlf
print "hy1-> "
# Get user input for line one
sync
getstr one 75 K_LINE|K_NOEXASC
# ┌─────────────────────────────────────────────────────────────┐
# │ If input is NULL on first line, quit by going back to TOP. │
# └─────────────────────────────────────────────────────────────┘
compare one ""
if_true
cmd_pop
goto top
end_if
print "hy2-> "
# Get user input for line two
sync
getstr two 75 K_LINE|K_NOEXASC
# ┌────────────────────────────────────────────────────────────────┐
# │ If input is NULL on any other line, it is assumed user is done │
# │ entering his/her message, and it is time to convert it. │
# └────────────────────────────────────────────────────────────────┘
compare two ""
if_true
cmd_pop
goto convert
end_if
print "hy3-> "
# Get user input for line three - same procedure as input for first line.
sync
getstr three 75 K_LINE|K_NOEXASC
compare three ""
if_true
cmd_pop
goto convert
end_if
print "hy4-> "
# Get user input for line four - same procedure as input for first line.
sync
getstr four 75 K_LINE|K_NOEXASC
compare four ""
if_true
cmd_pop
goto convert
end_if
:convert
# ┌─────────────────────────────────┐
# │ Define File Variable. │
# │ If file not present, create it. │
# │ If file present, truncate data. │
# └─────────────────────────────────┘
int userinput
fopen userinput O_CREAT|O_TRUNC|O_WRONLY|O_APPEND "c:\sbbs\jive\jivepost.dat"
# ┌───────────────────────────────────────────────┐
# │ Print variable ONE (first line input) to File │
# │ Adding Line feeds & Returns. (\r\n) │
# └───────────────────────────────────────────────┘
fprintf userinput "%s\r\n" one
# ┌───────────────────────────────────────────────────┐
# │ If Variable two, or remaining variables are null, │
# │ close file and let us begin conversion (DOIT). │
# └───────────────────────────────────────────────────┘
compare two ""
if_true
fclose userinput
cmd_pop
goto doit
end_if
fprintf userinput "%s\r\n" two
compare three ""
if_true
fclose userinput
cmd_pop
goto doit
end_if
fprintf userinput "%s\r\n" three
compare four ""
if_true
fclose userinput
cmd_pop
goto doit
end_if
fprintf userinput "%s\r\n" four
# ┌─────────────┐
# │ Close'em Up │
# └─────────────┘
fclose userinput
# ┌───────────────────────────────────────────────────┐
# │ Option to User on how to convert his/her message, │
# │ giving them a chance to abort (Quit). │
# └───────────────────────────────────────────────────┘
:doit
print "\r\nngConvert to whJngive, whVngalleyspeak, whMngix "
print "or whQnguit?h y (wJVMQy)w > n"
sync
getcmd JMQV
# ┌─────────────────┐
# │ Convert to JIVE │
# └─────────────────┘
cmdkey J
crlf
print "hwHo'd yo' hosses, bawse! I'se a-changin' yo honky-type to Jive!"
crlf
# ┌───────────┐
# │ ALERT!!! └─────┐
# │ Below Path OK? └───────┐
# │ Paths in LAWDIE.BAT Ok? │
# └─────────────────────────┘
exec "command /c c:\sbbs\jive\lawdie"
crlf
print "hy.,.,.,.,.,.,.,.,.,. mDONE!\r\n"
pause
cmd_pop
goto altered
end_cmd
# ┌──────────────────────────────────────┐
# │ Convert to MIX of JIVE & VALLEYSPEAK │
# └──────────────────────────────────────┘
cmdkey M
crlf
print "whGag me wid spoon! I'se changin' your text to ValJive, fershure, bro'!"
crlf
# ┌───────────┐
# │ ALERT!!! └─────┐
# │ Below Path OK? └────────┐
# │ Paths in VALJIVE.BAT Ok? │
# └──────────────────────────┘
exec "command /c c:\sbbs\jive\valjive"
crlf
print "hy.,.,.,.,.,.,.,.,.,. mDONE!\r\n"
pause
cmd_pop
goto altered
end_cmd
# ┌────────────────────────┐
# │ Convert to VALLEYSPEAK │
# └────────────────────────┘
cmdkey V
crlf
print "whLike, wait a minute, 'k? ' Cuz like, I'm changing your text to ValleySpeak!"
crlf
# ┌───────────┐
# │ ALERT!!! └─────┐
# │ Below Path OK? └─────────┐
# │ Paths in FERSHURE.BAT Ok? │
# └───────────────────────────┘
exec "command /c c:\sbbs\jive\fershure"
crlf
print "hy.,.,.,.,.,.,.,.,.,. mDONE!\r\n"
pause
cmd_pop
goto altered
end_cmd
# ┌─────────────────────────┐
# │ Quit (Abort Conversion) │
# └─────────────────────────┘
cmdkey Q
cmd_pop
goto top
end_cmd
# Fall Thru just in case...
cmd_pop
goto top
# ┌─────────────────────────────────────────────┐
# │ Time to show converted JIVEpost to user. │
# │ Posts don't always turn out like you want. │
# └─────────────────────────────────────────────┘
:altered
crlf
print "gh─────────────────────────────────────────────────────────────────────────────ng"
crlf
# ┌───────────┐
# │ ALERT!!! │
# │ Path OK? └─────────────┐
# └─────────────────────────┘
printfile "c:\sbbs\jive\jivepost.jiv"
crlf
print "gh─────────────────────────────────────────────────────────────────────────────ng\r\n"
print "\r\nrhIs this OK to post? y (wYn/hwNy) > n"
# ┌────────────────────────────────────────────┐
# │ Are they happy with the converted results? │
# └────────────────────────────────────────────┘
sync
getcmd NY
# ┌──────────────────────────────────────────────────┐
# │ Don't like input? Damn...go back to top of menu │
# └──────────────────────────────────────────────────┘
cmdkey N
cmd_pop
goto top
end_cmd
# ┌──────────────────────────────────────┐
# │ Mikey Likes It! Let's Post the Jive │
# └──────────────────────────────────────┘
cmdkey Y
# ┌───────────────────────────────────────────────────────┐
# │ Defining and Adding a message Divider to the message. │
# │ Strictly for visual balance when reading messages. │
# │ Probably could be done differently...but I'm tired! │
# └───────────────────────────────────────────────────────┘
str divider
set divider "gh─────────────────────────────────────────────────────────────────────────────"
# ┌───────────┐
# │ ALERT!!! │
# │ Path OK? └─────────────────────────────────────────────────┐
# │ Opening open up their converted message and adding divider. │
# └─────────────────────────────────────────────────────────────┘
int liner
fopen liner O_WRONLY|O_APPEND "c:\sbbs\jive\jivepost.jiv"
fprintf liner "\r\n%s" divider
fclose liner
# ┌───────────────────────────────────────────────────────────────┐
# │ Defining another file to be used for SMBUTIL user data input. │
# │ This Script uses SMBUTIL i option - See Manual 2.20 page 193 │
# └───────────────────────────────────────────────────────────────┘
int file
str towho subjeck
# ┌───────────┐
# │ ALERT!!! │
# │ Path OK? └──────────────────────────────────────────┐
# │ SMBUTIL uses this data file to import file into SMB. │
# └──────────────────────────────────────────────────────┘
fopen file O_CREAT|O_TRUNC|O_WRONLY|O_APPEND "c:\sbbs\jive\jiveuser.dat"
# ┌──────────────────────────────┐
# │ Line 1: Jivepost TO: ALL │
# │ (Formality - Not really used.│
# └──────────────────────────────┘
set towho "ALL\r\n"
fprintf file "%s" towho
# ┌────────────────────────┐
# │ Line 2: Jivepost FROM: │
# └────────────────────────┘
fwrite file _useron.alias
# ┌──────────────────────────────┐
# │ Line 3: Jivepost SUBJECT: │
# │ (Formality - Not really used.│
# └──────────────────────────────┘
set subjeck "\r\nJivePosts\r\n"
fprintf file "%s" subjeck
# ┌─────────────┐
# │ Close'em Up │
# └─────────────┘
fclose file
# ┌───────────┐
# │ ALERT!!! └─────┐
# │ Below Path OK? └────────┐
# │ Paths in IMPORT.BAT Ok? └────────────────────────┐
# │ The Commandline in IMPORT.BAT is what imports the │
# │ converted Jivepost.Jiv into the Jivepost SMB. │
# └───────────────────────────────────────────────────┘
exec "command /c c:\sbbs\jive\import"
cmd_pop
goto top
end_cmd
# Fall thru just in case...
cmd_pop
goto top
# ┌─────────────┐
# │ Exit Script └─────────────────────────────────────────┐
# │ Turn Flag 1B back off which hides the JivePosts from │
# │ normal Message Reading Access. The Jivepost message │
# │ base doesn't exist to the user unless in this Script. │
# │ Like a hidden room eh? │
# │ Revert everything back to the way it was for the user.│
# └───────────────────────────────────────────────────────┘
:byebye
compare_ars $F1B
if_true
toggle_user_flag 1 B
end_if
revert_text 1
revert_text 2
revert_text 3
revert_text 4
revert_text 5
revert_text 6
revert_text 7
revert_text 8
revert_text 9
revert_text 71